﻿using Super.Hmi.Models;
using Super.Hmi.ViewModels.Base;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Super.Hmi.ViewModels
{
    public class MainViewModel : ViewModelBase
    {
        public ObservableCollection<MenuModel> MenuModels { get; set; } = new ObservableCollection<MenuModel>();
        public MainViewModel()
        {
            // 加载菜单模型
            LoadMenuModels();
        }

        private void LoadMenuModels()
        {
            List<MenuModel> menuModels = new List<MenuModel>()
            {
                new MenuModel{ Title="信号", Icon="\xe7ff",MenuChild = new List<MenuModel>
                {
                    new MenuModel{Title = "程序启动", Icon="\xe6af"},
                    new MenuModel{Title = "程序停止", Icon="\xe61f"},
                    new MenuModel{Title = "监听", Icon="\xe61c"},
                    new MenuModel{Title = "内部触发", Icon="\xe607"},
                    new MenuModel{Title = "IO扫描", Icon="\xe68b"},
                    new MenuModel{Title = "PLC扫描", Icon="\xe68b"},
                }},
                new MenuModel{ Title="文件", Icon="\xec4c",MenuChild = new List<MenuModel>
                {
                    new MenuModel{Title = "写csv", Icon="\xe7f1"},
                    new MenuModel{Title = "读文本", Icon="\xec4c"},
                    new MenuModel{Title = "写文本", Icon="\xe6d5"},
                    new MenuModel{Title = "移动复制\r\n文本", Icon="\xe616"},
                    new MenuModel{Title = "移动复制\r\n文件夹", Icon="\xe839"},
                    new MenuModel{Title = "删除文件\r\n夹", Icon="\xe617"},
                    new MenuModel{Title = "删除文件", Icon="\xe611"},
                }},
                new MenuModel{ Title="流程", Icon="\xe624",MenuChild = new List<MenuModel>
                {
                    new MenuModel{Title = "分支", Icon="\xe98e"},
                    new MenuModel{Title = "分支选择", Icon="\xe6ab"},
                    new MenuModel{Title = "循环开始", Icon="\xe602"},
                    new MenuModel{Title = "循环结束", Icon="\xe655"},
                }},
            };
            MenuModels = new ObservableCollection<MenuModel>(menuModels);
        }
    }
}
